import request from "@/utils/request";
/**
 * @author chenyq
 * @Date 20210806
 * 查询分页数据
 * @param {*} params
 * @returns
 */
export function pages(params) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/yxpz/formClassify/pageFormClassifys",
    method: "get",
    params: params
  });
}

//保存方法
export function saveOrUpdate(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/yxpz/formClassify/saveOrUpdateFormClassify",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}

//查询
export function queryById(id) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/yxpz/formClassify/getFormClassify?id=" +
      id,
    method: "get"
  });
}

/**
 * 切换状态
 * @param {*} serviceOid
 * @param {*} stateFlag
 */
export function tiggerStateById(id, status) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/yxpz/formClassify/ableFormClassify/${id}/${status}`,
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

export function delById(id) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/yxpz/formClassify/deleteFormClassify/${id}`,
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}
